using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter03
{
	/// <summary>
	/// Example02: A Vacation Trip
	/// A car travels 20.0 km due north and then 35.0 km in a 
	/// direction 60.0^{\circle} west of north, 
	/// as shown in Figure 3.12a. 
	/// Find the magnitude and direction of the car's resultant 
	/// displacement.
	/// </summary>
	public class Example02
	{
		public Example02()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Displacement d1 = new L.Displacement();
			d1.X = 0.0;
			d1.Y = 20.0;
			L.Displacement d2 = new L.Displacement();
			d2.Y = 35.0*Math.Cos(60.0*Math.PI/180.0);
			d2.X = -35.0*Math.Sin(60.0*Math.PI/180.0);

			L.Vector f = d1 + d2;

			result += Convert.ToString(f.Norm)+"     ";
			result += Convert.ToString((Math.Atan(f.Y/f.X)+Math.PI)*180.0/Math.PI);

		}
	}
}
